<!--
 * @Author: 白羽
 * @Date: 2023-06-05 18:49:02
 * @LastEditors: 白羽 1665169869@qq.com
 * @LastEditTime: 2023-06-17 13:00:17
 * @FilePath: \scriptcat-push-weixin\test.html
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>
        Lorem, ipsum.
        <!-- <b>Lorem, ipsum.</b> -->
    </p>
    <script>
        const tamplate = `

{{DATA.num}}
    `.trim();
        function replaceTemplate(DATA = {}, str = "") {
            const regex = /\{\{(DATA\.[_|a-z|A-Z\d|\w|\.]*)\}\}/gm;
            let matches = [...str.matchAll(regex)];
            matches.forEach(match => {
                str = str.replace(match[0], eval(match[1]));
            });
            return str;
        }

    </script>
</body>

</html>